Shader "Custom/Gooch" {
	Properties {
		_MainTex ("Base (RGB)", 2D) = "white" {}
		_BumpMap("Bump map",2d) = ""{}
		_Warm("Warm Color",color) = (1,0,0,0)
		_Cold("Cold Color",color) = (0,0,1,0)
	}
	SubShader {
		Tags { "RenderType"="Opaque" }
		LOD 200
		
		CGPROGRAM
		#pragma surface surf SimpleLambert
		
		sampler2D _MainTex;
		sampler2D _BumpMap;
		half4 _Warm;
		half4 _Cold;
		
		half4 LightingSimpleLambert(SurfaceOutput s,half3 lightDir,half atten){
			half NdotL = dot(s.Normal,lightDir);
			NdotL = (NdotL + 1.0) * 0.5;
			half4 c = lerp(_Warm,_Cold,NdotL);
			return c;
		}

		struct Input {
			float2 uv_MainTex;
			float2 uv_BumpMap;
			float3 worldNormal;
		};

		void surf (Input IN, inout SurfaceOutput o) {
			half4 c = tex2D (_MainTex, IN.uv_MainTex);
			o.Albedo = c.rgb;
			o.Alpha = c.a;
			o.Normal = UnpackNormal(tex2D(_BumpMap,IN.uv_BumpMap));
		}
		ENDCG
	} 
	FallBack "Diffuse"
}
